package com.itheima.chapter10.blockQueue;

import java.util.concurrent.ArrayBlockingQueue;

public class Producer extends Thread{
    private ArrayBlockingQueue<String> abq;

    public Producer(ArrayBlockingQueue<String> abq) {
        this.abq=abq;
    }

    @Override
    public void run() {

        while (true) {
            try {
                abq.put("汉堡");
                System.out.println("生产者生产汉堡111");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
